#include <QDebug>
#include "simple.h"

Simple::Simple(QObject *parent, const QString &n)
    : QObject{parent}, name(n)
{
    checkTimer = new QTimer(parent);
    connect(checkTimer, &QTimer::timeout, this, &Simple::checkTimerCallBack);
    checkTimer->start(3000);
}

void Simple::checkTimerCallBack(void)
{
    QString status = name;
    status += " status changed";
    emit StateChanged(status);
}

QString Simple::SayHello()
{
    QString HelloStr = "Hello, I'm ";
    HelloStr += name;
    return std::move(HelloStr);
}

int Simple::Add1(int a, int b)
{
    qDebug() << "add1 called";
    return a + b;
}

int Simple::Add2(int a, int b)
{
    qDebug() << "add2 called";
    return a + b;
}


QString Simple::NotImplementFunc()
{
    return "This function cannot be called via dbus interface";
}
